package com.dnjn.happiness.emo.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dnjn.happiness.emo.domain.UserRecordFer;
import com.dnjn.happiness.emo.domain.vo.UserRecordFerExportVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.List;

/**
 * 用户AI情绪userRecordFerMapper接口
 * 
 * @author amber
 * @date 2023-12-04
 */
public interface UserRecordFerMapper extends  BaseMapper<UserRecordFer>
{

    Double getAIHappinessScores(@Param("userId") Long userId, @Param("time") String time);

    Page<UserRecordFer> getPage(@Param("dto") UserRecordFer userRecordFer,@Param("page") Page page);

    Page<UserRecordFer> selectAi(@Param("userId") Long userId, @Param("emotionCode") String emotionCode, @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("page") Page page);

    Page<UserRecordFer> selectAiPage(@Param("vo") UserRecordFer vo,@Param("page") Page page);

    List<UserRecordFerExportVo> getExportList(@Param("dto") UserRecordFer vo);

    @Update("update emo_user_record_fer set deleted='1' where user_id = #{userId} and curr_date= #{currDate}")
    int removeByUserInfoAndCurrDate(@Param("userId") Long userId, @Param("currDate") LocalDate currDate);

    List<UserRecordFer> selectAll(@Param("dto") UserRecordFer userRecordFer);
}
